count number of digits in java